let mongoose = require('mongoose');

// mongoose.connect('mongodb://localhost/verse')     //连接本地数据库blog
// mongoose.connect('mongodb://root:fanya0725@localhost/verse?authSource=admin&readPreference=primary&ssl=false')     //连接本地数据库blog

console.log()
const location = 'mongodb://124.71.32.133:27017/i18n'
mongoose.connect(location, {
    authSource: ["admin"],
    auth: {
        username: "root",
        password: "root"
    }
})

let db = mongoose.connection;

// 连接成功
db.on('open', function () {
    console.log('MongoDB Connection Success');
});
// 连接失败
db.on('error', function () {
    console.log('MongoDB Connection Error');
});
